Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous Pipeline Changes #326

Merged
merged 26 commits into from
May 5, 2020

Conversation

PlagueHO
Copy link
Member

@PlagueHO PlagueHO commented Apr 27, 2020

Pull Request (PR) description

Update ModuleBuilder to Latest.
Merge HISTORIC_CHANGELOG.md into CHANGELOG.md.
Change Azure DevOps Pipeline trigger to include source/*.

This PR also includes a fix for #323.

I also a known issue info to address #294.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
    Entry should say what was changed, and how that affects users (if applicable).
  • Resource documentation added/updated in README.md in resource folder.
  • Resource parameter descriptions added/updated in schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Resource Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
  • New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

@johlju - would you mind reviewing for me?


This change is Reviewable

@PlagueHO PlagueHO added the needs review The pull request needs a code review. label Apr 27, 2020
@PlagueHO
Copy link
Member Author

Hold off on this one @johlju - I'm not sure why Integration tests are failing. There wasn't any change that would have affected that so it may be something that has changed with the agent.

@johlju johlju added waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. and removed needs review The pull request needs a code review. labels Apr 27, 2020
@johlju
Copy link
Member

johlju commented Apr 27, 2020

No worries. Let me know when it is ready to review. 🙂

@PlagueHO
Copy link
Member Author

PlagueHO commented May 4, 2020

Hi @johlju - this PR is now ready to review. I had to make some additional changes to get the tests to pass.

@johlju johlju added needs review The pull request needs a code review. and removed waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels May 4, 2020
Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 4 files at r1, 6 of 6 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @PlagueHO)


source/DSCResources/DSC_ScheduledTask/DSC_ScheduledTask.psm1, line 1955 at r3 (raw file):

-not $force -and

Shouldn't this be $force -and (remove -not) otherwise this will be done when Force -eq $false.

Looks like there is no unit test for that scenario so it wasn't caught. 🙂

@johlju johlju added waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. and removed needs review The pull request needs a code review. labels May 4, 2020
Copy link
Member Author

@PlagueHO PlagueHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 7 of 9 files reviewed, 1 unresolved discussion (waiting on @johlju)


source/DSCResources/DSC_ScheduledTask/DSC_ScheduledTask.psm1, line 1955 at r3 (raw file):

Previously, johlju (Johan Ljunggren) wrote…
-not $force -and

Shouldn't this be $force -and (remove -not) otherwise this will be done when Force -eq $false.

Looks like there is no unit test for that scenario so it wasn't caught. 🙂

The logic is actually correct based on the intent, but due to the double negatives isn't obvious. So I added a comment to clarify. I also added one more test to confirm.

Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

All good. Didn't look at the logic close enough. 🙂

Reviewed 2 of 2 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@johlju
Copy link
Member

johlju commented May 5, 2020

Closing and reopening to kick of the tests again since it failed on. I have seen this when the previous run is to fast to the LCM haven't time to cooldown.

CimException: Cannot invoke the Get-DscConfiguration cmdlet. The Consistency Check or Pull
cmdlet is in progress and must return before Get-DscConfiguration can be invoked. Use -Force 
option if that is available to cancel the current operation.

https://dev.azure.com/dsccommunity/ComputerManagementDsc/_build/results?buildId=1818&view=logs&j=bed57fa5-efa2-5e6c-3967-59915169b168&t=5a0501c2-c194-508e-8f56-358cb6bbc353&l=383

In xWebAdministration and SqlServerDsc I have added the following helper function between tests where this happens (not everywhere though). Might be better to add it to Initialize-TestEnvironment.

https://github.com/dsccommunity/SqlServerDsc/blob/fab9419549a490efab38e070e8eda40d2a10d531/tests/TestHelpers/CommonTestHelper.psm1#L398-L409

@johlju johlju closed this May 5, 2020
@johlju johlju reopened this May 5, 2020
@PlagueHO
Copy link
Member Author

PlagueHO commented May 5, 2020

Thanks for that @johlju . In other resources we used to use the Reset-Dsc function that was part of the Test initialization and/or test helper, but this got eliminated by the move to the new CI process. I meant to add something back in but haven't had time. I created this many years back for xPSDesiredStateConfiguration I think. Anyway, I'll aim to roll your fix in.

@PlagueHO PlagueHO merged commit 29db49a into dsccommunity:master May 5, 2020
@PlagueHO PlagueHO deleted the Issue-324-and-325 branch May 5, 2020 06:01
@PlagueHO
Copy link
Member Author

PlagueHO commented May 5, 2020

Sidenote: the reason why we decided to force the LCM to stop (Reset-Dsc) rather than to wait is that the LCM on occasion took a long time to complete so forcing a stop resulted in faster test completion in these situations. xPSDesiredStateConfiguration was very problematic here (often jamming up multiple times in a single CI run).

@johlju
Copy link
Member

johlju commented May 5, 2020

Aha, so maybe that is why we are starting to see these error because "Reset-Dsc" was removed. I'm good with Reset-Dsc too if it helps tests to run faster. But the Wait-ForIdleLcm has worked perfectly. I seen it at the most wait up to 8 seconds to continue (4 retries). Though, that is 8 seconds we could save with Reset-Dsc. 🙂

@PlagueHO
Copy link
Member Author

PlagueHO commented May 5, 2020

I'm OK either way - but it would be good if we could unify the functions everywhere. E.g. Perhaps create a DscResource.TestHelper module that contains some of this shared code. Not that it is really a big deal replicating it between modules.

Anyway, I've raised some issues in they key repos where this is a problem and will address when I get time (need to do some more module conversions to new CI tonight).

@johlju
Copy link
Member

johlju commented May 5, 2020

I agree a test helper module would be great, I thought about that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author.
Projects
None yet
2 participants